/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.base.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.validator.constraints.Length;

import com.chlitina.store.common.persistence.BaseEntity;
import com.chlitina.store.modules.sys.entity.Store;

/**
 * 综合充值卡模板Entity
 * @author liujiang
 * @version 2013-11-02
 */
@Entity
@Table(name = "store_card_template_all")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class StoreCardTemplateAll extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 编号
	private Store store; 	// 店面
	private String name; 	// 综合充值卡名称
	private float product_discount; // 购买产品折扣
	private float care_discount;	// 购买护理项目折扣
	private float retail_price;	// 零售价
	private float real_cost;	// 开卡优惠价
	private int status;	//会员卡模板状态0  -  可用1  -  不可用
	
	public StoreCardTemplateAll() {
	}

	public StoreCardTemplateAll(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(cascade={CascadeType.REFRESH}, fetch = FetchType.LAZY) 
	@JoinColumn(name="STORE_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public Store getStore() {
		return store;
	}

	public void setStore(Store store) {
		this.store = store;
	}
	
	@Length(min=1, max=64)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public float getProduct_discount() {
		return product_discount;
	}

	public void setProduct_discount(float product_discount) {
		this.product_discount = product_discount;
	}

	public float getCare_discount() {
		return care_discount;
	}

	public void setCare_discount(float care_discount) {
		this.care_discount = care_discount;
	}

	public float getRetail_price() {
		return retail_price;
	}

	public void setRetail_price(float retail_price) {
		this.retail_price = retail_price;
	}

	public float getReal_cost() {
		return real_cost;
	}

	public void setReal_cost(float real_cost) {
		this.real_cost = real_cost;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}
}


